package com.yiyuan.app.controller;

import com.guaike.core.entity.result.Result;
import com.yiyuan.app.entity.param.DealSignDTO;
import com.yiyuan.app.entity.result.SignVO;
import com.yiyuan.app.service.SignService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.*;

import javax.validation.Valid;

@RestController
@RequestMapping("/sign")
@Api(tags = "签到相关接口组")
@AllArgsConstructor
public class SignController {

    private final SignService signService;

    @GetMapping("/signPageInfo")
    @ApiOperation(value = "签到页面信息")
    public Result<SignVO> signPageInfo() {
        return signService.signPageInfo();
    }

    @PostMapping("/dealSign")
    @ApiOperation(value = "确定签到")
    public Result<Boolean> dealSign(@RequestBody @Valid DealSignDTO param) {
        return signService.dealSign(param);
    }
}
